home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / ronset25.zip / RONSET.DOC < prev    next >
Text File  |  1990-08-18  |  40KB  |  993 lines

  1.  
  2.                             RONSET
  3.                             ------
  4.  
  5.                         Batch file enhancer
  6.                         Copyright (C) Ron Bemis 1990
  7.                         All rights reserved
  8.                         Version 2.3
  9.                           
  10.  
  11. I use DOS environment variables extensively, and I wanted a better way to
  12. set and use them.  I couldn't find it, so I wrote it myself.  Here it is -
  13. my idea of the ultimate batch file utility.  It lets you set environment
  14. variables to whatever you like... with brains.  It does what DOS should
  15. have done.  This program is the equivalent of the internal DOS SET command,
  16. but it's much more powerful.  You can use it just like you use SET.
  17.  
  18. I hope you'll enjoy this program, and I also hope that you'll consider
  19. sending in a registration if you like it.  Please let me know if you find
  20. something that doesn't work like you think it should.  Also, please let me
  21. know if you think of any enhancements for this program.
  22.  
  23.                  - Ron Bemis, FidoNet 124/1113, 214-231-3841
  24.  
  25. RONSET is shareware!  That means that if you use it on a regular basis, you
  26. must pay for it.  You are hereby granted a limited licence to use this
  27. program for a period of one month.  At the end of this month, you must
  28. either register this program or discontinue its use.  This program may NOT
  29. be used in a business, for-profit organization, or corporate environment
  30. without first being registered.  Registration price for this program is $20
  31. per machine.  Registrations should be mailed to:
  32.  
  33.                Ron Bemis
  34.                9601 Forest Ln #222
  35.                Dallas, TX  75243
  36.  
  37.  
  38. Happy batchin'!
  39.  
  40.  
  41. By the time you're done playing with this program, you should understand
  42. what the following line does and how it works:
  43.  
  44. RONSET fname=low(concat(hex(string(Net:,5)),hex(string(Node:,5))).REQ)
  45.  
  46. At least try each function by itself on the command line to see how they
  47. work.  Satisfy yourself that each function does work as you think it
  48. should.  I think there's about a zillion things you can do with this
  49. program if you cut loose with the creative juices.
  50.  
  51. The above illustrates how you can "nest" RONSET commands to execute a number
  52. of them at the same time and with respect to the same environment variable. 
  53. But we're gettin' ahead of ourselves, here. 
  54.  
  55.  
  56.         COMMAND SYNTAX:
  57.  
  58. RONSET variable_name=function(parameters)
  59.  
  60.         In which:
  61.  
  62. variable_name   is replaced by the name of the environment variable you
  63.                 want to create or replace;
  64.  
  65. function        is any one of the many functions listed in this
  66.                 documentation;
  67.  
  68. (parameters)    are additional commands you give to RONSET.  These commands
  69.                 are dependent upon the function you have asked for.
  70.  
  71. All function parameters MUST be enclosed entirely within parenthesis as
  72. shown above. In this documentaiton, the word "parameter" refers to whatever
  73. it is you're enclosing within the parenthesis.
  74.  
  75. Some other ways to use RONSET:
  76.  
  77. RONSET variable_name=               will clear the specified environment
  78.                                     variable (i.e. remove it from the
  79.                                     environment).
  80.  
  81. RONSET function(parameters)         will execute the function specified,
  82.                                     but not set an environment variable.
  83.  
  84.  
  85. Arithmetic functions
  86. --------------------
  87. All arithmetic is done with floating point numbers.
  88.  
  89. add(addend,addend)
  90.     returns the sum of the two values
  91.         Example:                            Result:
  92.         RonSet Sum=add(15,32)               SUM=47
  93.  
  94. sub(minuend,subtrahend)
  95.     returns the difference of the two values
  96.         Example:                            Result:
  97.         RonSet Diff=sub(19,25)              DIFF=-6
  98.  
  99. mult(multiplicand,multiplier)
  100.     returns the product of the two values
  101.         Example:                            Result:
  102.         RonSet Prod=mult(15,32)             PROD=480
  103.  
  104. div(dividend,divisor)
  105.     returns the quotient of the two values
  106.         Example:                            Result:
  107.         RonSet Quot=div(100,7)              QUOT=14.2857
  108.  
  109. eq(x,y)
  110.     returns 1 if x is equal to y, 0 otherwise
  111.         Example:                            Result:
  112.         RonSet X=eq(5,6)                    X=0
  113.         RonSet X=eq(5,5)                    X=1
  114.  
  115. ne(x,y)
  116.     returns 1 if x is not equal to y, 0 otherwise
  117.         Example:                            Result:
  118.         RonSet X=ne(5,6)                    X=1
  119.         RonSet X=ne(5,5)                    X=0
  120.  
  121. lt(x,y)
  122.     returns 1 if x is less than y, 0 otherwise
  123.         Example:                            Result:
  124.         RonSet X=lt(5,6)                    X=1
  125.         RonSet X=lt(5,5)                    X=0
  126.         RonSet X=lt(6,5)                    X=0
  127.  
  128. le(x,y)
  129.     returns 1 if x is less than or equal to y, 0 otherwise
  130.         Example:                            Result:
  131.         RonSet X=le(5,6)                    X=1
  132.         RonSet X=le(5,5)                    X=1
  133.         RonSet X=le(6,5)                    X=0
  134.  
  135. gt(x,y)
  136.     returns 1 if x is greater than y, 0 otherwise
  137.         Example:                            Result:
  138.         RonSet X=gt(5,6)                    X=0
  139.         RonSet X=gt(5,5)                    X=0
  140.         RonSet X=gt(6,5)                    X=1
  141.  
  142. ge(x,y)
  143.     returns 1 if x is greater than or equal to y, 0 otherwise
  144.         Example:                            Result:
  145.         RonSet X=ge(5,6)                    X=0
  146.         RonSet X=ge(5,5)                    X=1
  147.         RonSet X=ge(6,5)                    X=1
  148.  
  149. abs(x)
  150.     returns the absolute value of x
  151.         Example:                            Result:
  152.         RonSet X=abs(-5)                    X=5
  153.         RonSet X=abs(10)                    X=10
  154.         RonSet X=abs(-2.3)                  X=2.3
  155.  
  156. mod(x,y)
  157.     returns x modulo y
  158.         Example:                            Result:
  159.         RonSet Rmn=mod(15,4)                RMN=3
  160.         RonSet Rmn=mod(20,4)                RMN=0
  161.         RonSet Rmn=mod(17,13)               RMN=4
  162.  
  163. neg(x)
  164.     returns negative x
  165.         Example:                            Result:
  166.         RonSet Neg=neg(15)                  NEG=-15
  167.         RonSet Neg=neg(-7.3)                NEG=7.3
  168.  
  169. sqr(x)
  170.     returns x squared
  171.         Example:                            Result:
  172.         RonSet Big=sqr(83)                  BIG=6889
  173.         RonSet Big=sqr(-100)                BIG=10000
  174.         RonSet Big=sqr(23.5)                BIG=552.25
  175.  
  176. sqrt(x)
  177.     returns the square root of x
  178.         Example:                            Result:
  179.         RonSet Root=sqrt(9)                 ROOT=3
  180.         RonSet Root=sqrt(8.7)               ROOT=2.94958
  181.  
  182. pow(x,y)
  183.     returns x to the y power
  184.     this one is an exception to the rules about errorlevels
  185.     if invalid values are specified, a different type of error message (one
  186.     from the floating point run-time library) is displayed, and the program
  187.     may abort with an errorlevel other than 255.
  188.         Example:                            Result:
  189.         RonSet OneK=pow(2,10)               ONEK=1024
  190.         RonSet Big=pow(7,5)                 BIG=16807
  191.  
  192.  
  193. Binary functions
  194. ----------------
  195. All binary functions are done with 16-bit unsigned numbers.
  196.  
  197. and(x,y)
  198.     returns the bitwise AND of x and y
  199.         Example:                            Result:
  200.         RonSet X=and(14,7)                  X=6
  201.  
  202. or(x,y)
  203.     returns the bitwise OR of x and y
  204.         Example:                            Result:
  205.         RonSet X=or(14,7)                   X=15
  206.  
  207. xor(x,y)
  208.     returns the bitwise XOR of x and y
  209.         Example:                            Result:
  210.         RonSet X=xor(14,7)                  X=9
  211.  
  212. not(x)
  213.     returns the 1's complement of x
  214.         Example:                            Result:
  215.         RonSet X=not(14)                    X=65521
  216.  
  217. hex(x)
  218.     returns the 4-digit hexidecimal equivalent of x
  219.         Example:                            Result:
  220.         RonSet X=hex(124)